//
//  OnlineHeaderCollectionViewCell.m
//  GC_OC
//
//  Created by 曾 on 2022/1/23.
//

#import "OnlineHeaderCollectionViewCell.h"

@implementation OnlineHeaderCollectionViewCell

-(void)initView:(CGFloat)width andDic:(NSDictionary *)dic
{
    self.iconImageView.frame=CGRectMake((width-hig(40))/2.0,0,hig(40),hig(40));
    self.iconImageView.image=[UIImage imageNamed:@"收藏"];
    self.nameLabel.frame=CGRectMake(0,hig(40),width,hig(85)-hig(40));
    self.nameLabel.text=dic[@"name"];
    self.nameLabel.textColor=[UIColor blackColor];
    self.nameLabel.font=[UIFont systemFontOfSize:FontSize(10)];
    self.nameLabel.textAlignment=NSTextAlignmentCenter;
//    self.nameLabel.adjustsFontSizeToFitWidth=YES;
    self.nameLabel.baselineAdjustment=UIBaselineAdjustmentAlignCenters;
    NSString *imageStr = dic[@"media_image"];
    imageStr = [imageStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:imageStr] placeholderImage:[UIImage imageNamed:@"logo_gray_zw"]];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

@end
